﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Collections;
using System.Reflection;
using UMC.Wiki.Entities;
using UMC.Web.UI;
using UMC.Web;
using System.IO;

namespace UMC.Wiki.Activities
{



    class SubjectSectionsActivity : WebActivity
    {


        public override void ProcessActivity(WebRequest request, WebResponse response)
        {
            // var type = this.AsyncDialog("Type", "none");
            switch (this.AsyncDialog("Type", "none"))
            {
                case "Home":
                    var footBar = new List<WebMeta>
                    {
                        new WebMeta().Put("text", "内容", "key", "Tabs", "cmd", request.Command, "model", request.Model, "icon", "\uf1b3", "RefreshEvent", "Proxy.Site"),
                        new WebMeta("text", "随手记", "icon", "\ue907").Put("max", true).Put("click", new UIClick(request.Model, "Content")),
                        new WebMeta().Put("text", "我的", "key", "Pager", "cmd", "Self", "model", "Account", "icon", "", "RefreshEvent", "UI.Setting").Put("search", new WebMeta("Type", "Setting"))
                    };
                    this.Context.Reset(new WebMeta().Put("footBar", footBar));
                    break;
                default:
                    var stitle = "知识录";
                    UITitle title = new UITitle(stitle);

                    title.Banner("知识录");
                    title.Name("icon", "\uea0e");

                    title.Right(new UIEventText().Icon('\uf2e1').Click(UIClick.Scanning()));
                    var list = new List<WebMeta>
                    {
                        new WebMeta().Put("model",request.Model, "cmd", "UI", "text", "知识推荐").Put("RefreshEvent", "Subject.Save"),
                        new WebMeta().Put("model",request.Model, "cmd", "Follow", "text", "我的关注").Put("RefreshEvent", "Subject.Save"),
                        new WebMeta().Put("model", request.Model, "cmd", "Self", "text", "我的文档").Put("RefreshEvent", "Subject.Save")
                    };

                    response.Redirect(new WebMeta().Put("title", title).Put("sections", list));
                    break;
            }


        }

    }
}